﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FrienDev.Data;
using FrienDev.BusinessRules;

public partial class Public_ClubInvite : System.Web.UI.Page
{
    protected string AppId = ApplicationSettings.WindowsLiveLogin.AppId;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["uid"]) && !string.IsNullOrEmpty(Request.QueryString["clubid"]))
        {
            string userId = Request.QueryString["uid"].Trim();
            int cid = Convert.ToInt32(Request.QueryString["activityid"]);
            Session.Add("ClubID", cid);
            User user = UserRules.Instance.GetUserByUserId(userId);
            img_UserLogo.ImageUrl = ApiHelper.Instance.GetUserBigLogoUrl(user.UserId);
            Club club = ClubRules.Instance.GetClubByClubId(cid);
            if (!string.IsNullOrEmpty(Request.QueryString["isreg"]))
            {
                Session.Add("IsInviteeRegisted", true);
                lb_Title.Text = user.FullName + "邀请您参加" + club.ClubName + "俱乐部";
                lb_Tip.Text = "点击“登录网站”，登录后即可直接看到该俱乐部详情";
            }
            else
            {
                lb_Title.Text = user.FullName + "邀请您参加" + club.ClubName + "俱乐部";
                lb_Tip.Text = "该网站需要您使用Windows Live ID进行登录并补全个人信息，请点击“登陆网站”以进一步完成操作，补全个人信息后，即可看到该俱乐部详情";
            }
        }
    }
}
